#pragma once

#define MIN( a, b ) (a < b) ? a : b
#define MAX( a, b ) (a > b) ? a : b


#define	SHIFT_BIT(n)		( 1 << (n) ) 
#define IS_BIT_SET(x,n)		( (x) & SHIFT_BIT( n ) ) 
#define SET_BIT(x,n)		( (x) |= SHIFT_BIT( n ) ) 
#define RESET_BIT(x,n)		( (x) &= ~SHIFT_BIT( n ) ) 
#define TOGGLE_BIT(x,n)		( (x) ^= SHIFT_BIT( n ) )

uint8_t getHighByte(uint16_t int16){
	return (int16 & 0xff00) >> 8;
}

uint8_t getLowByte(uint16_t int16){
	return int16 & 0x00ff;
}
